#include <QApplication>
#include <QStyleFactory>
#include <QDir>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    // 设置应用程序信息
    app.setApplicationName("富文本编辑器");
    app.setApplicationVersion("1.0");
    app.setOrganizationName("Your Company");

    // 设置应用程序样式
    app.setStyle(QStyleFactory::create("Fusion"));

    // 设置全局样式表，让界面更美观
    app.setStyleSheet(
        "QMainWindow {"
        "    background-color: #f0f0f0;"
        "}"
        "QMenuBar {"
        "    background-color: white;"
        "    border-bottom: 1px solid #d0d0d0;"
        "}"
        "QMenuBar::item {"
        "    padding: 6px 12px;"
        "    background-color: transparent;"
        "}"
        "QMenuBar::item:selected {"
        "    background-color: #e3f2fd;"
        "}"
        "QStatusBar {"
        "    background-color: white;"
        "    border-top: 1px solid #d0d0d0;"
        "}"
        "QScrollBar:vertical {"
        "    background-color: #f0f0f0;"
        "    width: 12px;"
        "    border-radius: 6px;"
        "}"
        "QScrollBar::handle:vertical {"
        "    background-color: #c0c0c0;"
        "    border-radius: 6px;"
        "    min-height: 20px;"
        "}"
        "QScrollBar::handle:vertical:hover {"
        "    background-color: #a0a0a0;"
        "}"
        "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {"
        "    border: none;"
        "    background: none;"
        "}"
    );

    // 创建并显示主窗口
    MainWindow window;
    window.show();

    return app.exec();
}
